Skip to content

Adopt Uno.Sdk tooling on Uno Platform 7.0 - #880

Draft
MartinZikmund wants to merge 12 commits into
CommunityToolkit:mainfrom
MartinZikmund:mzikmund/uno7-sdk
Draft

MartinZikmund wants to merge 12 commits into
CommunityToolkit:mainfrom
MartinZikmund:mzikmund/uno7-sdk

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Moves the toolkit to the Uno.Sdk-based tooling on Uno Platform 7.0 (WinUI 3). This recreates #862 on Uno 7 instead of 6.x.

Important

Draft. It depends on the tooling PR CommunityToolkit/Tooling-Windows-Submodule#317 and on Uno 7 dev builds. The submodule pointer references the tooling branch on a fork and will move to the merged commit.

Changes

  • Adopt Uno.Sdk tooling: a squash of Adopt Uno.Sdk tooling (Uno 6.x) for the WinUI 3 gallery #862 (Uno.Sdk gallery head, linuxgtk → linux, new win32 MultiTarget, CI for the Uno.Sdk head).
  • Uno 7 / .NET 10:
    • global.json: .NET SDK 10.0.401, Uno.Sdk 7.0.0-dev.51, MSBuild.Sdk.Extras 3.0.44.
    • CI: DOTNET_VERSION and net10.0-* TFMs.
    • TabbedCommandBar's MSBuild.Sdk.Extras/3.0.23 pins bumped to 3.0.44.
  • Uno 7 source fixes (one commit each):
    • DependencyObjectExtensions: where T : class, DependencyObject only on Uno 5 (HAS_UNO && WINUI2). DependencyObject is a class in Uno 7, so this was CS0450.
    • CompositionExtensions.InsertExpressionKeyFrame: use the overload without easing when easing is null. Uno 7 annotates the parameter as non-nullable.
    • TokenizingTextBoxAutomationPeer.GetChildrenCore: an #if HAS_UNO && WINUI3 shim for Uno returning List<> instead of IList<>. Fixed upstream in fix(automation): Align ListViewBaseAutomationPeer.GetChildrenCore return type with WinUI unoplatform/uno#25141; drop the shim once that ships.

Validation

  • With the tooling PR, CommunityToolkit.App.Uno builds for net10.0-desktop with 0 errors.
  • The gallery runs on Uno 7 Desktop (Win32): navigation, search and sample pages work, and the sample code viewer is syntax-highlighted via RichTextBlock.
  • For the local run, Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI was swapped for a local pack of feat: Update to Uno Platform 7.0 unoplatform/Uno.XamlBehaviors#36. The published 3.0.3 is built against Uno 5 and fails to compile in Behaviors/SettingsControls on Uno 7. That swap is not included here.

Remaining before ready

  • Bump Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI (Behaviors, SettingsControls samples) once Uno.XamlBehaviors#36 is published.
  • Move the submodule to the merged tooling commit.
  • Follow-up: enable RichSuggestBox on Uno once RichEditBox lands in Uno.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E8bkzyS24p8CYDWLUPsaPC

/// Identifies the <seealso cref="To"/> dependency property.
/// </summary>
// typeof(TValue?) is only used as dependency property metadata, not for reflective construction.
#pragma warning disable IL2087

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These suppressions shouldn't be needed, DependencyProperty.Register doesn't annotate that type parameter as [DynamicallyAccessedMembers] or anything.

@ajpinedam ajpinedam Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Sergio0694 (@MartinZikmund is on vacation, reason why I am chiming in to help).

Those suppressions are needed for Uno: Uno's DependencyProperty.Register annotates propertyType with [DynamicallyAccessedMembers] (WinUI's doesn't). With IsAotCompatible and "warnings as errors", typeof(TValue?) triggers IL2087 and breaks Uno's build.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! This seems wrong, and suppressing warnings is bad practice and not recommended by the .NET team. The way I see it, there's basically two possible options:

  • The [DAM] annotation is correct, the metadata is required, so the suppression is wrong
  • The suppression is wrong, meaning the annotation is incorrect, and it should just be removed then

Like, if [DAM] isn't actually necessary, can't Uno update DependencyProperty.Register to remove that? Otherwise this will also generate a ton of warnings in consuming projects. E.g. I have dozens and dozens of generated dependency property. If every one of those will produce an IL warning, that is bad.

Also @ajpinedam suppressing this only applies to the ILLink analyzer. It does not apply to ILC, meaning you'd still see an actual IL warning when you publish with AOT. Can we address this properly from the Uno side? This seems like a blocker to me, especially because it's not actionable for users.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, based on:

https://github.com/unoplatform/uno/blob/daa747637db0e4e51071e29d99d58aa467686755/src/Uno.UI/UI/Xaml/DependencyProperty.cs#L163-L183

this type is going to be passed to FixMetadataIfNeeded and that one is going to construct the type:

https://github.com/unoplatform/uno/blob/daa747637db0e4e51071e29d99d58aa467686755/src/Uno.UI/UI/Xaml/DependencyProperty.cs#L188-L204

This is an invalid suppression and breaks that callsite. not for reflective construction part of the comment looks at minimum misleading.

Suppressing a trimming warning is in 90% of cases I've seen a bug.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the FixMetadataIfNeeded behavior is optional, there should be another Register overload that doesn't fix metadata if needed and can be without annotations so that it doesn't impose unnecessary requirements on callers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Sergio0694 and understand the concern. Let me investigate on Uno's side how to change/fix this

MartinZikmund and others added 6 commits October 27, 2026 06:43
Squashed recreation of CommunityToolkit#862 on current main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E8bkzyS24p8CYDWLUPsaPC
Matches the tooling: .NET SDK 10.0.401, Uno.Sdk 7.0.0-dev.51, MSBuild.Sdk.Extras 3.0.44.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E8bkzyS24p8CYDWLUPsaPC
DependencyObject is a class in Uno 7, so 'class, DependencyObject' fails with CS0450.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E8bkzyS24p8CYDWLUPsaPC
Uno 7 annotates the parameter as non-nullable. Use the overload without easing instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E8bkzyS24p8CYDWLUPsaPC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E8bkzyS24p8CYDWLUPsaPC
Bumps tooling to the matching Uno.WinUI 7.0.0-dev.2428, which returns IList<AutomationPeer>
from ListViewBaseAutomationPeer.GetChildrenCore (unoplatform/uno#25141), so the
TokenizingTextBoxAutomationPeer signature shim is no longer needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu1DnHGnhiqjJz6RnRw
MartinZikmund and others added 6 commits October 27, 2026 07:09
Uno 7 annotates the propertyType of DependencyProperty registration for trimming, so
registering a property of type System.Type flags Type's own annotated members.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu1DnHGnhiqjJz6RnRw
Uno 7 annotates ApiInformation's type name parameters for trimming, so the unqualified
WinRT names fail with IL2122. XamlRoot and AccessibilitySettings.HighContrast always
exist on WinUI 3, matching what Behaviors' ApiInformationHelper already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu1DnHGnhiqjJz6RnRw
3.0.3 is built against Uno.WinUI 5, so Behavior types weren't WinUI 3 DependencyObjects on Uno 7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu1DnHGnhiqjJz6RnRw
Uno 7 implements RichEditBox. On Uno 5 (WinUI 2) RichEditBox is still a stub, so the control
builds there but isn't functional.

Also fixes IsXamlRootAvailable, whose WinAppSDK/UWP branches were swapped, and a nullable
Window.Current dereference on Uno 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu1DnHGnhiqjJz6RnRw
Builds the Uno.Sdk gallery heads against the local Converters, SettingsControls, Extensions
and Triggers projects instead of the Uno 5 packages, and fixes NU1510 in net10.0 sample projects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu1DnHGnhiqjJz6RnRw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu1DnHGnhiqjJz6RnRw

@Sergio0694 Sergio0694 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking this, see #880 (comment).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants